$(function () {
    $("#save").click(function() {
        if (check()) {
            $("#teacherInfo").submit();
        }
    })
});
function check() {
    var teachername =$("#teachername");
    var teacherdepartment = $("#teacherdepartment");
    var teacheremail =$("#teacheremail");
    if(teachername.val()==""){
        alert("姓名不能为空")
        return false;
    }
    if(teacherdepartment.val()==""){
        alert("系/所不能为空")
        return false;
    }
    if(teacheremail.val()==""){
        alert("邮箱不能为空")
        return false;
    }
    return true;
}

